﻿@model WebApp.Models.S_document

@{
    Layout = "~/Views/Shared/_DialogLayout.cshtml";
}

@using (Html.BeginForm("", "", FormMethod.Post, new { @class = "form-horizontal form-inline", id = "inputform" }))
{
    <div class="dialog-content">
        @Html.AntiForgeryToken()
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })

        <input type="hidden" id="Id" value="@Model.Id" class="form-control datafield" data-fieldname="Id" />

        <div class="row">
            <div class="col-xs-12 nopadding">
                <table cellpadding="3" cellspacing="0" border="0" class="inputform">
                    <tr>
                        <td class="td-label"><span style="color:red">*</span><label for="Code">编号</label></td>@*编号*@
                        <td class="td-control">
                            @Html.TextBox("DocKey", @Model.DocKey, new { @class = "form-control datafield", @data_fieldname = "DocKey", @style = "width:200px;" })
                        </td>
                    </tr>
                    <tr>
                        <td class="td-label"><span style="color:red">*</span><label for="Name">标题(简体)</label></td>@*标题*@
                        <td class="td-control">@Html.TextBox("Title", @Model.Title, new { @class = "form-control datafield", @data_fieldname = "Title", @style = "width:200px;" })</td>
                        <td class="td-label"><span style="color:red">*</span><label for="Name">标题(繁体)</label></td>@*标题*@
                        <td class="td-control">@Html.TextBox("TitleHK", @Model.TitleHK, new { @class = "form-control datafield", @data_fieldname = "TitleHK", @style = "width:200px;" })</td>
                    </tr>
                </table>
            </div>
            <div class="col-xs-12 nopadding">
                <div id="tab" class="easyui-tabs" data-options="plain:true,border:false">
                    <div title="内容(简体)" style="padding:10px;" id="tabremark">
                        <!-- 加载编辑器的容器 -->
                        <script id="editor" type="text/plain">
                        </script>
                    </div>
                    <div title="内容(繁体)" style="padding:10px;" id="tabremark">
                        <button id="btnlang" class="btn btn-mini btn-default">简转繁</button>
                        <!-- 加载编辑器的容器 -->
                        <script id="editor_hk" type="text/plain">
                        </script>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="dialog-footer">
        <button id="btncancel" class="btn btn-small btn-default">取消</button>@*取消*@
        <button id="btnsave" class="btn btn-small btn-primary" style="display:none">保存</button>@*保存*@
    </div>
}

@section scripts{
    <!-- 配置文件 -->
    <script src="~/Content/ueditor1_4_3/ueditor.config.js"></script>
    <!-- 编辑器源码文件 -->
    <script src="~/Content/ueditor1_4_3/ueditor.all.js"></script>

    <script type="text/javascript">
        var canEdit = @(ViewBag.CanEdit ? "true" : "false");

        var ue = UE.getEditor('editor', {
            autoHeight: true,
            toolbars: [
           ['fullscreen', 'source', '|', 'undo', 'redo', '|', 'fontfamily', 'fontsize', 'bold', 'italic', 'underline', 'fontborder', '|', 'forecolor', 'backcolor']],
            initialFrameHeight: 360,
            initialFrameWidth: 950,
            autoHeightEnabled: false,
            enableAutoSave: true,
            elementPathEnabled: false,
            wordCount: false,
            autoSyncData: false,
            fullscreen: false
        });
        var uehk = UE.getEditor('editor_hk', {
            autoHeight: true,
            toolbars: [
           ['fullscreen', 'source', '|', 'undo', 'redo', '|', 'fontfamily', 'fontsize', 'bold', 'italic', 'underline', 'fontborder', '|', 'forecolor', 'backcolor']],
            initialFrameHeight: 340,
            initialFrameWidth: 950,
            autoHeightEnabled: false,
            enableAutoSave: true,
            elementPathEnabled: false,
            wordCount: false,
            autoSyncData: false,
            fullscreen: false
        });

        UE.getEditor('editor').ready(function () {
            ue.setContent('@(Html.Raw(Model.Content.Replace("\n", "").Replace("\r", "").Replace("'", "\\'")))', false);
        });
        UE.getEditor('editor_hk').ready(function () {
            uehk.setContent('@(Html.Raw(Model.ContentHK.Replace("\n", "").Replace("\r", "").Replace("'", "\\'")))', false);
        });
    </script>

    <script type="text/javascript" src="~/Scripts/app/basic/document.edit.js?ver=@WebApp.BLL.CommonStr.Ver"></script>
    <script type="text/javascript" src="~/Scripts/lang_zh_cn2hk.js?ver=@WebApp.BLL.CommonStr.Ver"></script>

}
















